<template>
    <div class="appTable">
        <div class="table">
            <div class="mask"></div>
            <div class="table_title">{{ table_title }}管理</div>
            <div class="table_btns" v-if="operate && showAdd">
                <el-button @click="handleAdd" style="margin-right: 4%" type="primary" icon="el-icon-folder-add">添加</el-button>
            </div>
            <div class="table_body">
                <zy-table :loading="loading" :tableData="tableData" :tableColumn="tableColumn" :pageSize="pagination.pageSize" :total="pagination.total" @changePage="changePage"></zy-table>
            </div>
            <zy-form ref="zyform" :dialog="dialog" @add="add" @set="edit"></zy-form>
        </div>
        <el-dialog class="elDialog" title="日志详情" :visible.sync="isShow" width="60%">
            <div style="white-space: pre-line; font-size: 16px; color: #88e8f2; line-height: 22px; user-select: text">{{ content }}</div>
        </el-dialog>
    </div>
</template>
<script>
import { column } from './formConfig.js'
import BasicManage from '@/components/basic/BasicManage.vue'
export default {
    extends: BasicManage,
    data() {
        return {
            table_title: '后端日志',
            url: 'log',
            showAdd: false,
            isShow: false,
            content: '',
        }
    },
    created() {
        column[column.length - 1].buttons = [
            {
                text: '详情',
                click: (val) => {
                    this.content = val.content
                    this.isShow = true
                },
                icon: 'el-icon-s-comment',
            },
            {
                text: '删除',
                click: (val) => {
                    this.delete(val)
                },
                icon: 'el-icon-delete',
            },
        ]
        column[column.length - 1].if = this.operate
        this.tableColumn = column
        this.getlist()
    },
}
</script>
